<?php
$con = mysql_connect("localhost:3307", "root", "123456")
or die("数据库服务器连接失败！<br>");
//**********found**********
mysql_select_db("nrce-09", $con) or die("数据库选择失败！<br>");
if (isset($_GET['del'])) {
    $sid = $_GET['del'];
    $delstudent = 'delete from student where sid=' . $sid;
//**********found**********
    mysql_query($delstudent, $con);
}
$sql_student = "SELECT sid,sname,score,deptname FROM student s,dept d where s.deptno=d.deptno";
$result_student = mysql_query($sql_student, $con);
?>
<!-- **********found********** -->
<table border='1px'>
    <tr>
        <td>结果序号</td>
        <td>学号</td>
        <td>姓名</td>
        <td>成绩</td>
        <td>系别名称</td>
        <td>操作</td>
    </tr>
    <?php
    //**********found**********
    $counter = 0;
    while ($rows_student = mysql_fetch_array($result_student)) {
        $counter++;
        ?>
        <tr>
            <td><?php echo $counter; ?></td>
            <td><?php echo $rows_student[0]; ?></td>
            <td><?php echo $rows_student[1]; ?></td>
            <td><?php echo $rows_student[2]; ?></td>
            <td><?php echo $rows_student[3]; ?></td>
            <td><a href='sj3.php?del=<?php echo $rows_student[0]; ?>' onclick='return confirm("确定要删除吗")'>删除</a></td>
        </tr>
        <?php
    }
    mysql_close($con);
    ?>
</table>
<!-- **********found********** -->
<br/>所有学生的信息(共有 <?php echo $counter ?> 人)：<br/>
